// Copyright (c) 2002 HTHK

/********************************************/
  // Creation History
  // --------------------------------------------------------------
  //	Company:			HTHK
  //	NAME:				Rate.java
  //    Title   :			Reflect the Rate Data Table
  //	FUNCTION:
  //	BY:				Poly
  //	DATE:				2004-01-09
  // --------------------------------------------------------------
/*********************************************/

package tss.rate;

import com.ffpc.sql.*;

import tss.rate.RateBean;

public class Rate
   extends DataObject
   implements RateBean
{
   private String grade = null;
   private String rate = null;
   private String overtime_rate = null;
   private String create_date = null;
   private String create_by = null;
   private String upd_date = null;
   private String upd_by = null;
   private Column ColGrade = null;
   private Column ColRate = null;
   private Column ColOvertimeRate = null;
   private Column ColCreateDate = null;
   private Column ColCreateBy = null;
   private Column ColUpdDate = null;
   private Column ColUpdBy = null;
   /**
    * Constructor
    */
   public Rate()
   {
       ColGrade = new Column(0,"grade",Column.Types.string,null,50,false);
       ColRate = new Column(1,"rate",Column.Types.number,null,10,false);
       ColOvertimeRate = new Column(1,"overtime_rate",Column.Types.number,null,10,false);
       ColCreateDate = new Column(2,"create_date",Column.Types.time,null,7,false);
       ColCreateBy = new Column(3,"create_by",Column.Types.string,null,10,false);
       ColUpdDate = new Column(4,"upd_date",Column.Types.time,null,7,true);
       ColUpdBy = new Column(5,"upd_by",Column.Types.string,null,10,true);
   }

   // functions belongs to RateBean interface

   @Override
public void setGrade(String grade)
   {       this.grade = this.setAttribute(ColGrade,grade);
   }

   @Override
public String getGrade()
   {       return this.grade==null?"":this.grade;
   }

   @Override
public void setRate(String rate)
   {       this.rate = this.setAttribute(ColRate,rate);
   }

   @Override
public String getRate()
   {       return this.rate==null?"":this.rate;
   }

   @Override
public void setOvertime_rate(String overtime_rate)
   {       this.overtime_rate = this.setAttribute(ColOvertimeRate,overtime_rate);
   }

   @Override
public String getOvertime_rate()
   {       return this.overtime_rate==null?"":this.overtime_rate;
   }

   @Override
public void setCreate_date(String create_date)
   {       this.create_date = this.setAttribute(ColCreateDate,create_date);
   }

   @Override
public String getCreate_date()
   {       return this.create_date==null?"":this.create_date;
   }

   @Override
public void setCreate_by(String create_by)
   {       this.create_by = this.setAttribute(ColCreateBy,create_by);
   }

   @Override
public String getCreate_by()
   {       return this.create_by==null?"":this.create_by;
   }

   @Override
public void setUpd_date(String upd_date)
   {       this.upd_date = this.setAttribute(ColUpdDate,upd_date);
   }

   @Override
public String getUpd_date()
   {       return this.upd_date==null?"":this.upd_date;
   }

   @Override
public void setUpd_by(String upd_by)
   {       this.upd_by = this.setAttribute(ColUpdBy,upd_by);
   }

   @Override
public String getUpd_by()
   {       return this.upd_by==null?"":this.upd_by;
   }

   // belongs to row interface

   @Override
public Column[] createColumns()
   {
       Column[] cols = new Column[7];
       cols[0] = ColGrade.clone(null);
       cols[1] = ColRate.clone(null);
       cols[2] = ColOvertimeRate.clone(null);
       cols[3] = ColCreateDate.clone(null);
       cols[4] = ColCreateBy.clone(null);
       cols[5] = ColUpdDate.clone(null);
       cols[6] = ColUpdBy.clone(null);
       return cols;
   }

   // super's abstract methods

   @Override
public String getTableName()
   {
       return "tss.tss_c_charge_out_rate";
   }

   @Override
protected String[] getKeyColumnNames()
   {
       String[] list = {
                         "grade"
                       };
       return list;
   }

   @Override
protected String[] getUpdatableColumnNames()
   {
       String[] list = {
                         "rate"
                         ,"create_date"
                         ,"overtime_rate"
                         ,"create_by"
                         ,"upd_date"
                         ,"upd_by"
                       };
       return list;
   }

   @Override
protected void retrieveColumnValues()
   {
       this.grade = this.retrieveColumnValue("grade");
       this.rate = this.retrieveColumnValue("rate");
       this.overtime_rate = this.retrieveColumnValue("overtime_rate");
       this.create_date = this.retrieveColumnValue("create_date");
       this.create_by = this.retrieveColumnValue("create_by");
       this.upd_date = this.retrieveColumnValue("upd_date");
       this.upd_by = this.retrieveColumnValue("upd_by");
   }
}

